<?php echo $this->Form->create('System', array('action' => 'changePassword','inputDefaults' => array(
        'error' => false
    )));?>
<div class="title">Đổi mật khẩu</div>
<?php if (isset($errors) && !empty($errors)): ?>
<div id="errors">
	<ul>
		<?php foreach ($errors as $rules):
			foreach ($rules as $key => $error):
			?>
			<li><?php echo $error;?></li>
		<?php endforeach; endforeach ?>
	</ul>
</div>
<?php endif ?>
<p>
	<span class="title">Mật khẩu cũ</span>
	<span>
		<span><?php echo $this->Form->password('User.oldpassword');?></span>
	</span>
</p>
<p>
	<span class="title">Mật khẩu mới</span>
	<span>
		<span><?php echo $this->Form->password('User.newpassword', 
			array('error' => array(
	        	'comparePasswords' => __('Typed passwords did not match.', true),
	        	'minLength' => __('The password should be at least 8 characters long.', true),
	        	'notEmpty' => __('The password must not be empty.', true)
	    	)));?></span>
	</span>
</p>
<p>
	<span class="title">Nhắc lại mật khẩu</span>
	<span>
		<span><?php echo $this->Form->password('User.renewpassword');?></span>
	</span>
</p>
<input type="submit" value="Cập nhật"/>
<?php echo $this->Form->end(); ?>
